<template>
	<view class="w-1 fl-s-c">
		<view class="w-1" style="height: 16rpx; background: #F5F5F5;"></view>
		<view class="w-1 p-r-30">
			<view @click="$u.route('/pages/Login/ForgetPwd')" class="w-1 relative bb-solid fr-s-c"
				style="padding: 30rpx 0;">
				<text class="c-33 bold fs-28 flex-1" style="width: 120rpx;">修改密码</text>
				<up-icon name="arrow-right"></up-icon>
			</view>
			<view @click="$u.route('/pages/Login/ChangePhone')" class="w-1 relative bb-solid fr-s-c"
				style="padding: 30rpx 0;">
				<text class="c-33 bold fs-28 flex-1" style="width: 120rpx;">更换手机号</text>
				<up-icon name="arrow-right"></up-icon>
			</view>
		</view>
		<view class="w-1" style="height: 16rpx; background: #F5F5F5;"></view>
		<view class="w-1 p-r-30">
			<view @click="$u.route('/pages/RichText/RichText?type=3')" class="w-1 relative bb-solid fr-s-c"
				style="padding: 30rpx 0;">
				<text class="c-33 bold fs-28 flex-1" style="width: 120rpx;">用户协议</text>
				<up-icon name="arrow-right"></up-icon>
			</view>
			<view @click="$u.route('/pages/RichText/RichText?type=2')" class="w-1 relative bb-solid fr-s-c"
				style="padding: 30rpx 0;">
				<text class="c-33 bold fs-28 flex-1" style="width: 120rpx;">隐私政策</text>
				<up-icon name="arrow-right"></up-icon>
			</view>
			<view @click="zx" class="w-1 relative bb-solid fr-s-c" style="padding: 30rpx 0;">
				<text class="c-33 bold fs-28 flex-1" style="width: 120rpx;">注销账号</text>
				<up-icon name="arrow-right"></up-icon>
			</view>
		</view>

		<view class="iphonex">
			<view class="p-30">
				<view class="big-btn fr-c m-t-25" style="background: #ff5c55; " @click="logout">退出当前账号</view>
			</view>
		</view>
	</view>
</template>


<script setup>
	import {
		reactive
	} from 'vue';

	function logout() {
		uni.clearStorageSync()
		uni.reLaunch({
			url: '/pages/Login/Login'
		})
	}

	function zx() {
		uni.showModal({
			title: '提示',
			content: '确认注销账号吗？',
			success: (res) => {
				if (res.confirm) {
					uni.$post({
						url: '/api/User/Cancel_user'
					}).then(res => {
						uni.clearStorageSync()
						uni.reLaunch({
							url: '/pages/Login/Login'
						})
					})
				}
			}
		})
	}
</script>

<style>
	page {
		background: #ffffff;
	}
</style>